I did it a bit younger, 35, but a few of the same principles would apply.
Context: moving to a new city with my wife and dog for a 1 year masters.
First of all, I absolutely loved it, particularly the course and the study. Getting up every morning with the main goal being learning is magnificent. My main piece of advice is that this is (in my experience) an excellent thing to do.
I've taken a whole new and highly satisfying path with my work since. All in all it's been one of my better life choices.
I was initially worried I'd struggle to keep up with my peers, based on the assumption they'd be more into the academic mindset, brighter and more energetic. Quite the opposite, I was pretty much top of my class.
I found I was able to use a lot of unexpected stuff from my career, and that treating it like a 9 to 5 made it easy to organise my work and get through the material.
You'll find some frustrations. I particularly hated the rigid course structure, and didn't see why I had to put up with modules I found irrelevant to my learning goals. YMMV depending on your course, but it's worth really kicking the tire on the non-optional stuff.
My favourite courses were hands down the optional stuff I was taking from PhD programs and other departments. My core stuff sucked for the most part.
It was also a little tough socially. I had course mates I really liked and respected, but most were in their twenties. I'm a happily married, mostly sober guy. We all had a very different idea of what a good time looks like. Probably different on a PhD program.
The lecturers will be your age or younger. I had a few good nights hanging out with them, but that was rare.
All in all, I wasn't that bothered with the social life because I was far too into the study to notice most of the time, but my wife (who was working remotely) found it hard.
I hope you go for it. It was an amazing experience for me.