The judgment shall not be vacated on motion or petition until it is adjudged that there is a valid defense to the action in which the judgment is rendered; or, if the plaintiff seeks its vacation, that there is a valid cause of action; and when judgment is modified, all liens and securities obtained under it shall be preserved to the modified judgment.