Stay.
It's not the kids fault. They deserve a happy, stable upbringing. Your mate has to man up and make sure that happens, for their sake.
When the kids are old enough, walk away if you still want to.
The older generation managed to make it work
....... Overcoming problems should make a sronger couple - life isn't always easy