If a lien provided for in sections 57-801 to 57-820 attaches to a leasehold interest, forfeiture of such leasehold interest shall not impair any lien as to material, appurtenances, and fixtures located thereon and to which such lien has attached prior to forfeiture. If a lien provided for in sections 57-801 to 57-820 attaches to an equitable interest or to a legal interest contingent upon the happening of a condition subsequent, failure of such interest to ripen into legal title or such condition subsequent to be fulfilled, shall not impair any lien as to material, appurtenances, and fixtures located thereon and to which such lien had attached prior to such failure.