Except as to any sale had by virtue of a judgment of foreclosure in accordance with Article XV of this Act, whenever any real estate has been or is sold at judicial or judgment sale to enforce a lien thereon and the real estate is subject to a mortgage lien which is prior and superior to the lien so foreclosed through that sale, the holder of the certificate of sale, may from time to time during the period of redemption pay any interest, principal or other obligation which is due and payable in accordance with the terms of the superior mortgage. If redemption is made from the sale, the party or parties entitled to redeem shall pay to the holder of the certificate of sale, or grantee under such deed, or to the sheriff or other officer who sold the real estate or his or her successor in office, in addition to the amount due on the certificate, or deed, the amount paid by the holder thereof or grantee therein for interest, principal or other obligation, together with interest thereon at the rate of 10% per annum, if before the redemption is made a receipt evidencing the payments of interest, principal and other obligations is filed with the sheriff or other officer who made the sale or his or her successor in office or exhibited by the holder of the certificate or grantee in such deed to the party redeeming if the redemption payment is made directly to the holder of the certificate, or the grantee in such deed.
735 ILCS 5/12-142