When a mortgage or deed of trust shall be given on real or personal estate, or when a lien shall be given by law, to secure the payment of a sum of money specified in any writing, an action or suit or other proceedings shall not be brought or had upon such lien, mortgage, or deed of trust to recover the sum of money so secured except within the time that may be allowed for the commencement of an action at law upon the writing in which the sum of money secured by such lien, mortgage, or deed of trust may be specified. In all cases where the remedy at law to recover the debt shall be barred, the remedy in equity on the mortgage shall be barred.
Miss. Code § 15-1-21