In case an owner of real property upon which an improvement is being or has been made, desires to convey or transfer an interest in such real property or any part thereof, and in case lienors having mechanics' liens against such real property, or any part thereof, notices of which were filed prior to the making of the deposit hereinafter in this section mentioned, and which said liens have not been discharged as in this article provided, shall, to the extent of at least fifty-five per centum of the aggregate amount for which such liens have been so filed, by an instrument or instruments in writing, duly acknowledged, designate and authorize one or more persons to consent to the execution and delivery of a deed or deeds conveying said real property or any part thereof, and in case the consent in writing, duly acknowledged, of such person or persons to the execution and delivery of such deed or deeds, and which said consent shall be conditioned for the deposit of a specified sum of money with the clerk of such county, shall be filed in the office of the clerk of the county where such real property is situated, together with such instrument or instruments of designation, then on the deposit of such specified sum with such county clerk all mechanics' liens, judgments and attachments, and all claims and liens acquired in any proceeding upon such judgments or under such attachments against such real property shall from the time of such deposit cease to be liens or encumbrances upon such real property, and such real property shall thenceforth be free and discharged from the same, and the same shall thenceforth be liens upon such sum so deposited and said county clerk upon such deposit being made shall forthwith enter upon the lien docket, indexed with the name of such owner, the facts relating to such deposit. A deposit of money made as prescribed in this section shall be repaid to such owner or his assignee upon the discharge or release of all such mechanics' liens, judgments and attachments. All deposits of money made as provided in this section shall be considered as paid into court and shall be subject to the provisions of law relative to the payment of money into court and the surrender of such money by order of the court. The court shall in any action brought to foreclose any of such liens or in any action brought to recover such deposit or any part thereof, direct the payment of such sum so deposited to the persons whose mechanics' liens, judgments, or claims secured by attachment shall have been established upon the trial, and the amount so paid shall be credited upon such mechanics' liens, judgments and claims. Upon such deposit being made as hereinbefore provided the lien of all judgments and attachments affecting such real property, and all claims and liens acquired in any proceedings upon such judgments or under attachments shall be liens upon such deposit. All judgments recovered upon the attachments issued upon a claim which, in whole or in part, is not for materials furnished, labor performed or moneys advanced for the improvement of such real property, shall be subordinate as a lien upon such sum so deposited to all mechanics' liens thereon, and shall also be subordinate to all judgments recovered upon and attachments issued upon claims for materials furnished, labor performed or moneys advanced for the improvement of such real property. In case such consent shall be conditioned also for the giving to one or more persons or a corporation as trustee or trustees any other property real or personal then any cash thereafter from time to time tendered by such trustee or trustees to such county clerk shall be received and held by such county clerk as though the same were part of the specified sum of money for the deposit of which such consent was conditioned, and for the same purposes and subject to the same provisions as in this section provided therefor.
N.Y. Lien Law § 31