One who obtains a thing without the consent of its owner, or by a consent afterwards rescinded, or by an unlawful exaction which the owner at the time could not refuse with prudence, shall restore it without demand to the person from whom it was obtained except in the following cases:
1. When the person has acquired a title thereto superior to that of the person from whom the property was taken;2. When the transaction is corrupt and unlawful on both sides; or3. When a thing is obtained by mutual mistake, and in such case the party obtaining the thing is not bound to return it until that person has notice of the mistake.