There are tire size comparison tools on the web where you can enter the dimensions and it shows you how things will change. The 40 aspect ratio tire will be an inch taller, which shouldn't be an issue size wise, but the main issue with going with a taller tire is that your speedo will be off and your ESP may react incorrectly in certain situations, because the speeds it reads are different from expected speeds. Your actual speed will be higher than what the car's sensors read. To make sure you won't have any potential issues you should code the correct tire size with Star Diagnostics and make sure your speedo gets calibrated for the new size as well. The difference is not that big between 35 and 40, though.
Here's a good comparison tool that gives you all the details:
https://tiresize.com/calculator/