In all actions in which the title to, or any interest in or lien upon, real property is involved or affected, or is brought in question by either party, any party thereto, at the time of filing the complaint, or at any time thereafter during the pendency of such action, may file for record with the county recorder of each county in which any part of the premises lies a notice of the pendency of the action, containing the names of the parties, the object of the action, and a description of the real property in such county involved, affected or brought in question thereby. From the time of the filing of such notice, and from such time only, the pendency of the action shall be notice to purchasers and encumbrancers of the rights and equities of the party filing the same to the premises. When any pleading is amended in such action, so as to alter the description of, or to extend the claim against, the premises affected, a new notice may be filed, with like effect. Such notice shall be recorded in the same manner in which mortgages are recorded, and may be discharged by writing executed and acknowledged in the manner of conveyance. The filing of such lis pendens at the time of filing the complaint and before the commencement of the action shall have no force, effect, or validity against the premises described in the lis pendens, unless the filing of the complaint is followed by the service of the summons in the action within 90 days after the filing of the complaint therein. Any party claiming any title or interest in or to the real property involved or affected may on such notice as the court shall in each case prescribe, make application to the district court in the county in which the action is pending or in which the real property involved or affected is situated, for an order discharging the lis pendens of record, when any such action has not been brought on for trial within two years after the filing of the lis pendens and in case the court orders the lis pendens discharged of record upon the filing of a certified copy of the order of the court in the office of the county recorder, where the real property is situated, the lis pendens shall be void and of no force nor effect.