After about age 9 or 10, sometimes earlier, kids know what an affair is. They need honest information, ideally from both parents together, that gives just the basic fact of the affair, and lets the kids know the parents are working on their problems. Kids should not be used as confidantes about one parent's affair or to take sides against the parent having the affair, no matter how furious the betrayed parent is. For the spouse it is a betrayal of the marital vows. You would be amazed how many secret affairs come to light in unexpected ways.
Most spouses feel that the secrecy and lying is more destructive of the marriage than the sex.
No, you can't really work on a marriage with one person holding this big secret. When you hold a secret, the process of hiding it also means that you have to start keeping other things secret, so eventually there's this black hole of stuff you can't talk about. Also, don't work on your marriage with a therapist who is willing for you to keep an affair a secret. It's got to be much harder to heal. Couples need privacy, not the advice of outsiders, even loving friends and relatives.