Upon the conditions herein prescribed for the protection of the state of New Mexico, the consent of the state is given to be named a party in any suit which is now pending or which may hereafter be brought in any court of competent jurisdiction of the state to quiet title to or for the foreclosure of a mortgage or other lien upon real estate or personal property, for the purpose of securing an adjudication touching any mortgage or other lien the state may have or claim on the premises or personal property involved.
NMS § 42-6-12