I feel your pain
I'm 51 and began cycling last April for the first time since I was about 16. I bought a £110 Rockrider 50 from
Decathlon. For the first 3-4 weeks I could only manage 5 miles at a time along the canal path followed by about 30 mins of gasping for breath on the kitchen floor, followed by a couple of days of hobbling around in pain. I had painful heels of my hands where I was leaning on the handlebars, and a mild sore neck.
By mid Autumn, I was regularly cycling for 15 miles with just a minute or two recovery. I bought a B'Twin 500 road bike which made riding on the road massively easier and faster. The pain in my hands went away sometime around the change in bike, though that might just have been a coincidence - I also got some cycling gloves with padding on the heels of the hand. Still had a mild sore neck, but my legs were fine.
Since then I have increased my mileage, done two or three 50 mile rides and will probably do a 70 mile ride next time there is decent weather at a weekend. Now, I am fully recovered by the time I have wiped down the bike after cycling for 50 miles and my legs have no pain whatsoever (the morning after my last 50, I went out for another 30 mile ride). I still have a sore neck and its caused a lot of pain in my right shoulder and arm (lots of muscles in spasm I think) - my theory is that for about 30 years I have sat at a desk working on computers and my posture is diabolical (rounded shoulders, head slightly leaning forwards, etc); riding for up to several hours in this position results in the pain I think, so I am currently trying to fix my posture (see the turtle link in
https://www.cyclechat.net/threads/shoulder-an-neck-pain-from-riding.168109/). Hopefully, this will sort things out.
So I would say keep riding and the legs will get used to it - build the distance up gradually. At various times I remember saying to my wife "No way I will ever ride more than x miles in one go", x being 5, 7, 10, 15, 18, 25, 30. I just don't say it any more - after a 50 mile ride at Christmas where it seemed like 49 miles was into-the-wind and most of the time it was sleeting pretty hard, I'm pretty confident that on a good day I could easily make 100 miles. I've also been going to spinning classes at the local leisure centre over winter and this has really built my leg strength up. For the pain in your hands and neck, I would look closely to see if there is a reason - for myself, I decided that if I wanted that pain to go away then I had to change something; it wasn't going to go away in time if I just ignored it.
Keep the faith - it will get easier as you ride more.