A trustee unless expressly forbidden by the instrument, if any, creating the trust, may, in lieu of proceeding to foreclosure, purchase the equity of redemption of land in New South Wales the subject of a mortgage held by the trustee under which default has been made where the moneys expended in such purchase are subject to the same trusts as the mortgage debt: Provided that in no case shall the moneys paid by way of consideration for such purchase exceed five per cent of the amount due under the mortgage.