Section 12. Assessments made under this chapter shall constitute a lien upon the land assessed. The lien shall take effect upon the recording of the order stating that betterments are to be assessed for the improvement. Notwithstanding any other provision of this section or chapter eighty-three, if a county, city, town, or district elects to send notice to the owner of the land assessed indicating the amount of the assessment for the betterment, and said owner pays the amount due, no lien shall be recorded. The assessors shall indicate on the next tax bill that the amount of the betterment assessment has been paid and no further notation or demand shall be made on land so assessed. Except as otherwise provided, such lien shall terminate at the expiration of two years from October first in the year in which the assessment is first placed on the annual tax bill under section thirteen or, if an assessment has been apportioned, from October first in the year in which the last portion is so placed upon the annual tax bill, whichever is later, if in the meantime in either case the estate has been alienated and the instrument alienating the same has been recorded. If there is no recorded alienation within such period, the lien shall continue until there is a recorded alienation. If the validity of an assessment made under this chapter is called in question in any legal proceeding to which the board which made the assessment or the body politic for the benefit of which it was made is a party, instituted prior to the expiration of the lien therefor, the lien shall continue until one year after the validity of the assessment is finally determined, even though an alienation be recorded in the meantime. If at any time while a lien established by this section is in force, a sale or taking cannot in the opinion of the collector be legally made because of any federal or state law or because of any injunction or other action of, or proceeding in, any federal or state court or because of the action of any administrative body, the lien shall, if the statement provided for in section thirty-seven A of chapter sixty is filed, continue as provided in said section thirty-seven A, subject, however, to any lawful action under any paramount authority conferred by the constitution or laws of the United States or the constitution of the commonwealth. If the time for payment of an assessment is extended under section thirteen A or under any general or special law, the lien shall, if the statement provided for in section thirty-seven A of chapter sixty is filed, continue as provided in said section thirty-seven A. A lien under this section may be dissolved by filing for record in the registry of deeds of the county or district where the land subject to the lien lies a certificate, in a form approved by the commissioner of revenue, from the collector of taxes that the assessment, constituting the lien, together with any interest and costs thereon, has been paid or legally abated. The collector of taxes shall charge four dollars for each certificate so issued, and the money so received shall be paid into the town treasury.