What is pain? Pain is your body telling you something is wrong. It’s either acute (Dude, you’re on fire) or chronic (dude, your body part is messed up) but either way, there is something wrong and it’s telling you to do something about it. It’s a lot easier to deal with acute pain (put the fire that is burning you out) than chronic (take these pills and hope for a cure in 5-10 years).
Boredom is writing’s acute and chronic pain. If it’s acute, the scene you’re working on right now is boring you to tears, but the rest of the book’s okay. Just cut back the boring bits until you get back to the part that you enjoyed writing and start over again. Don’t pay any attention to how many words you have to kill. 400 hurts, 40,000 is like hacking off an arm, but if you are bored with it and you’re emotionally invested in your characters, what possible hope do your readers have of getting past the boring bits?
It’s it’s chronic boredom and you’ve never felt exciting writing what you’re writing, you need to call a do-over. Sloppy writing can be cleaned up in successive rewrites. Making boring writing exciting takes more work than starting over does.
Your story’s exciting bits are the baby, and the boring bits are the bathwater. If at all possible, don’t throw them both away. But if all you have is bathwater, what are you really losing?