All such leases shall contain an option granting to the county or municipality the right to purchase the leased property upon the expiration of the primary term, or upon such earlier date as may be agreed upon, at a price not to exceed the unpaid principal balance at such time.