The mayor of a city, or selectmen of a town, may, in their discretion, upon any special occasion, grant permits to any persons to ride bicycles or mopeds, at any rate of speed, for a time not exceeding one day upon specified portions of the public ways of such city or town, and may annex such other reasonable conditions to such permits as they may deem proper.