One who pays to the owner any part of the price of real property, under an agreement for the sale thereof, has a special lien upon the property, independent of possession, for such part of the amount paid as he may be entitled to recover back, in case of a failure of consideration.