Which oaths require kafarah
Yahya related to me from Malik from Suhayl ibn Abi Salih from his father from Abu Hurayra that the Messenger of Allah (sa) said, "Whoever makes an oath and then sees that something else would be better than it, should do kaffara for his oath and do what is better." (Maliks Muwatta)
Abu Huraira reported: A person sat late in the night with Allah's Apostle (sa), and then came to his family and found that his children had gone to sleep. His wife brought food for him. but he took an oath that he would not eat because of his children (having gone to sleep without food) He then gave precedence (of breaking the vow and then expiating it) and ate the food He then came to Allahs Messenger (sa) and made mention of that to him, whereupon Allah's Messenger (sa) said: He who took an oath and (later on) found something better than that should do that, and expiate for (breaking) his vow. (Muslim)
It is excellent to break the vow if one finds a better alternative and then one should expiate it.