Sahih Muslim, Book 27, Hadith 20 (Muslim 4234)

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

He who took an oath and (later on) found another thing better than that, he should do that which is better, and expiate for the vow (broken by him).