All fees are invariably due in advance where demanded by the officer required to perform any official act, and no officer shall be required to perform any official act unless his or her fees are paid when he or she demands the same: PROVIDED, This section shall not apply when the officer performs any official act for his or her county or the state.