Create X 1/1 white Soldier creature tokens. If X is 5 or more, destroy all other creatures.
Martial Coup checks the number you chose for X, not the amount of mana you actually spent.
No one can cast spells or activate abilities between the time the Soldier tokens are put onto the battlefield and the time all other creatures are destroyed. For example, you can't sacrifice one of those Soldier tokens to regenerate a Skeletal Kathari.
You do what the spell says in order. If X is 5 or more, you'll put the Soldier tokens onto the battlefield, then you'll destroy all other creatures.