All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Whoever takes an oath and then breaks it, an oath expiation is due on him, i.e. to feed or clothe ten needy persons or free a slave. Whoever is not able to do any of those three, a three day expiatory fast is due on him.
Sometimes, breaking an oath may be better than keeping it. The Prophet, sallallaahu ‘alayhi wa sallam, said: “If one takes an oath to do something and then finds something else to be better than it, let him do what is better and make expiation for his oath.”
If one is coerced to do what he has sworn not to do, and the conditions of coercion are met, that is, the coercer is able to execute his threats and he threatens to damage the person's life, any organ of the body or property, and the other conditions stipulated by scholars in order for coercion to be effective, then by doing what he has sworn not to do, the oath will not be broken, and no expiation will be due on him. However, in the absence of those conditions of coercion, an oath expiation is due on him.
Allaah Knows best.