Notwithstanding the witness fees payable pursuant to N.H. Rev. Stat. § 592-A:13 to an off duty police officer, when such an officer is employed by a town or city of 50,000 or more population, he may receive from his town or city, in lieu of the witness fee so provided, the regular rate of pay that he would be entitled to if he were on duty. The provisions of this section shall apply only when such officer is required to appear in the superior court as a witness in a criminal case.