§ 56. Preference over contractors. When a laborer, subcontractor or material man shall perform labor or furnish materials for an improvement of real property or for a public improvement, for which he is entitled to a mechanic's lien, the amount due to him shall be paid out of the proceeds of the sale of such property or out of the moneys of the state or public corporation applicable to the construction or demolition of the public improvement, under any judgment rendered pursuant to this article, before any part of such proceeds is paid to the person for whom he has performed such labor or furnished such materials. If several notices of lien are filed for the same claim, as where the contractor has filed a notice of lien, for the services of his workmen, and the workmen have also filed notices of lien, the judgment shall provide for but one payment of the claim which shall be paid to the parties entitled thereto. Payment voluntarily made upon any claim filed as a lien shall not impair or diminish the lien of any person except the person to whom the payment was made.