An action to foreclose the equity of redemption of real property or real and personal property secured by a mortgage cannot be commenced if 12 years have elapsed since the cause of action accrued.