Section 22. After the commitment of a tax, including assessments for betterments or other purposes, to a collector for collection, the owner of the estate or person assessed or a person in behalf of said owner or person may, if the tax is a tax upon real estate, at any time and from time to time up to the date when an advertisement is prepared for the sale or taking of the real estate for the nonpayment of such tax or up to the date when the tax is certified under section sixty-one, and if the tax is a personal property tax, at any time and from time to time up to the date when a warrant or other process is issued for the enforcement and collection thereof, tender to the collector a partial payment of the tax not less than ten per cent of the total tax but in no event less in amount than ten dollars, which shall be received, receipted for and applied toward the payment of the tax. The acceptance of any partial payment in accordance with this section shall not invalidate any demand made for a tax, prior to the acceptance of such partial payment; provided that the amount stated in the demand was the amount due at the date when the demand was made. If in any court it shall be determined that the tax is more than the amount so paid, judgment shall be entered for such excess and interest upon the amount thereof to the date of the judgment, and on the amount paid to the date of payment, with costs if otherwise recoverable. The part payment authorized by this section shall not affect a right of tender, lien or other provision of law for the recovery of the amount of such tax, or interest or costs thereon, remaining due, but if the part payment is more than the tax, as finally determined, the excess, without interest, shall be repaid to the person who paid it.