(1) Except as provided in this section, a construction lien has priority over adverse claims against the real estate as if the construction-lien claimant were a purchaser for value without knowledge who had recorded at the time his or her lien attached.
(2) Except as provided in subsection (3) of this section, a construction lien has priority over subsequent advances made under a prior recorded security interest if the subsequent advances are made with knowledge that the lien has attached.
(3) Notwithstanding knowledge that the construction lien has attached, or the advance exceeds the maximum amount stated in the recorded security agreement and whether or not the advance is made pursuant to a commitment, a subsequent advance made under a security agreement recorded before the construction lien attached has priority over the lien if:
(a) The subsequent advance is made under a construction security agreement and is made in payment of the price of the agreed improvements;
(b) The subsequent advance is made or incurred for the reasonable protection of the security interest in the real estate, such as payment for real property taxes, hazard insurance premiums, or maintenance charges imposed under a condominium declaration or other covenant; or
(c) The subsequent advance was applied to the payment of any lien or encumbrance which was prior to the construction lien.
(4) To the extent that a subsequent security interest is given to secure funds used to pay a debt secured by a security interest having priority over a construction lien under this section, the subsequent security interest is also prior to the construction lien.
(5) Even though notice of commencement has been recorded, a buyer who is a protected party takes free of all construction liens that are not of record at the time his or her title document is recorded.