Similar thing happened to me, after almost 27 years, but my company was a great deal more respectful, in the way that they did it. I left on the best of terms; which is extremely rare, with layoffs. To this day, I still have a lot of respect for my old company.
Also, the writing had been on the wall, for years. I was quite prepared.
What I wasn't prepared for, however, was my post-layoff treatment by the modern tech industry. That was an eye-opener.
[dead]