He who took an oath, but he found something else better than that, should do that which is better and break his oath.

Sahih Muslim Book 27, Hadith 23