5) days of the recording of the notice of default under such deed of trust, if the power of sale therein is to be exercised, or otherwise at any time prior to the entry of a decree of foreclosure, may pay to the beneficiary or their successors in interest, respectively, the entire amount then due under the terms of the deed of trust and the obligation secured thereby, including costs and expenses