No real property shall be sold under any judgment or decree of court foreclosing any mechanic's or materialman's lien, mortgage, mortgage deed, trust deed or any other written instrument which may operate as a mortgage, until thirty days after the date of entry thereof, within which time the then owner of the real estate, his heirs, personal representatives, assigns or any junior lienholder may pay off the judgment or decree and avoid the sale by depositing in the office of the clerk of the district court in which the judgment, decree or order was entered the amount necessary to make payment thereof, including accrued interest and costs of suit.
NMS § 39-5-17