I have a lenovo x220 and had the same problem. Altough I checked the temp and it wasn’t excessive I have just changed the thermal paste and it has been working for 5 hours without shutting down. Before I couldn’t use it for 20 minutes and afterwards it kept shutting down all the time, even when idle even in the bios. I found a forum thread where this was the solution for many people with the same lenovo. Techs will tell you to change the motherboard. But it seems that this worked out for many people with this problem.