I messed up at work in my last job.
I was meant to send a letter (from a senior colleague) to someone external, and copy the address onto the envelope from the computer system. My job at the time was extremely "bitty", constantly chopping and changing from one task to another - multi-tasking, if you like. (Which I hate. I work best when I can concentrate on one task at a time.)
Anyway, I shared a computer with one of my colleagues. I got the address up on the system, and was about to copy it down, when my colleague needed to check something (using the same computer program). I let her, but as I was rushing to get the envelopes written on time for the postal service, forgot to check this one letter. I ended up writing the address my colleague had looked up on the envelope for the letter to someone else, and sending it.
We only found out when the person I'd accidentally addressed the letter to, sent it back to us, assuring us they didn't mind but they were just a little confused when they'd opened it.
Having some self-esteem problems to begin with, I was devastated. My boss was kind about it (though she did, gently, impress upon me and my colleague how serious it was), but I felt awful for the rest of the week. This was my first job, and I already felt that I wasn't great at it, so a mistake like that shook what little confidence I had.
In the end though, I got over it, my boss got over it, and I kept on working hard. Though I did make sure to double and triple-check letters before I sealed and sent them!
I'm sure your boss will be OK.
You've been a good employee for over 20 years, that surely counts for a lot. You've seen the boss, you've not been fired... just carry on working like you do. Everyone makes mistakes sometimes... I figure it's usually OK, so long as you learn from it.