If your budget is 40k and you're in the UK, I would advise to get a model 3 instead of an S unless there is reasons to get the larger vehicle. A model S is a great, beautiful car, but the older ones are indeed older, and have their various issues.
For roughly the same cost (not to mention, very likely a much better interest rate of a new car) you can get a car that fits the smaller roads better, as all the latest tech and computers, and even has almost as much range as the P85D did when new, and undoubtedly more now. More range means you can travel on holiday easier, and don't have to charge at home as frequently if you've the inclination. Also, the interior will still be undamaged, which every 5 year old car has some wear and tear to it.