Notwithstanding any law to the contrary, any judge of probate who has served for not less than 24 years on any one or more of such courts or has 24 years of creditable service in the Judicial Retirement Fund shall be eligible to retire under this chapter, regardless of age, if upon electing to retire with less than 25 years of service, prior to his or her date of retirement he or she pays to the Secretary-Treasurer of the Judicial Retirement Fund a lump sum in an amount equal to the annual employer and employee contributions necessary to purchase one year of creditable service in the fund based on the final annual state salary earned by the judge during his or her most recent fiscal year of active judicial service.