You're punishing yourself for your perceived failings as a mother by staying in a relationship with your husband, and nobody wins. You will convince yourself that it is better for your children this way but that is simply not true.
Some people want to be good with kids and aren't. Some people are, and don't want to be. Some people are only good with other people's kids. Some peple are amazing with kids and can't have them. Everyone gets bored on the 7th repetition of Wheels On The Bus. Nobody is a perfect mum all the time. Everybody puts too much pressure on themselves.
You are keeping yourself in a relationship with your husband because it hurts you. It gives you both an excuse to go and fuck someone else, therefore protecting yourself from being hurt too badly by any one person, and it punishes you for being a bad mother. It's a winner all-round, if the end game is that everyone is miserable.
Your DH isn't happy. He'll put up with this until something does make him happy, but then he's off. Anybody would be. You're not happy, but you'll hang around because you believe you deserve to be punished. You're playing the martyr. Your children are okay, for now, but eventually they'll notice that your relationship isn't the same as the other mummies and daddies and they'll want to know why. They'll get used to seeing relationships with no love and no passion and that is a fucking terrible stencil to set your own relationships by. You're doing them no favours. When they enter cold relationships with men who don't show emotion, will you wish that you'd left earlier and showed them how relationships could be?
One day, you'll stop punishing yourself. It'll probably be when your DH finds out about your affairs. You will then blame him, and you'll be angry, and you'll say he forced you into it. That will be tough because you'll put your children through infidelity, when they could have gone through a smooth separation. You could have set a shining example of how things can go right, how you deal with problems.
You have to get past punishing yourself though, and you have to get past being angry and over-analytical of every man that isn't your DH, when it's him that deserves it.