You seem to be finally realizing that job interviewing in the IT industry is a completely separate skill. Totally unrelated to the technical prowess you possess.
Since it's a skill, this means you can get better at it. You just need to work on it (as on any other skill).
As you already figured out, sitting in your chair at work, writing the code in your IDE, under the daily routine (coffee + music) is anything but even remotely comparable to the stress of having to "code" while standing in front of the person you never saw before, on the paperboard using a highlighter (or pen&paper).
It's great you realized something is wrong and it's even better that you figured it out while still having the old job. Trust me, you don't want to find that out when you're out of the job and doing the interviews (and waiting days/weeks till they schedule another round).
Now, I recommend doing a search and spending an evening or two with researching for what kind of questions are usually given at interviews (or just grab a book - plenty of those out there).
Then, grab a piece of paper and a pencil, and start coding on a paper. No IDE. No google. No music and no coffee.
This may take anywhere between 10-40 hrs of raw hand-writing, but you will get better at it.
What was the last time you spent a full hour writing just using your hand ? I found out my hand hurts like hell. Better to be prepared for things like that, than figuring them out when being stressed out at the IW.
Now, coding on paper is still way, way easier than on a big board with the highlighter. On a paper, you see easily 20-50 lines of a code. Not so much on a big board, where you gotta use bigger letters so that the interviewer can see it from distance.
There's no delete / enter on a paper with a highlighter. It truly sucks doing a typo during an interview, but you just gotta embrace the feeling and go with it, completely ignoring it.
To improve the skill further, there must be someone in your room, could be from your family or a friend. It's ok they don't know sh*t about IT. During an interview, you will be given lots of "why" questions anyway, so it's best to be prepared to be constantly interrupted, while you're trying to figure out how to insert a damn line between two lines already written on the big board.
10 months ago, when I was changing jobs, I did insane amount of interviewing (it's practically like two full-time jobs) and had a chance to really up the skills of interviewing, since some companies had 5-8 rounds of technical phone/online/on-site interviews.
In this world, no one really cares if you have the skills. But can you sell the skills you don't even have ? That's what really matters, regardless how crazy it sounds at first...