A 30wt oil is fine, but I’d be cautious going to a 40wt oil unless you’re absolutely sure the engine will be running hot and you have a proper oil temperature gauge.
Modern engines run tighter clearances than those of old, and the risk is that if you go out on a day where temperatures are mild and the engine is running at “normal” temperatures, you’re actually more likely to experience oil shearing (faster breakdown) and potentially oil starvation. Higher viscosity is only better until it can no longer flow where it needs to be.
Oil weights are a funny measurement as they change a lot with temperature and “W” oils are a bit misleading - for example at startup temperatures, a 0W30 is actually in between 5W20 and 5W30, because the 0W measurement only applies at something like -30C
The difference at most operating temperature from 5W20 to 5W30 is actually pretty small. Similar viscosity at about 5C higher temperature. However the jump to 5W40 is something like +25C (+45F) hotter for equivalent viscosity. So unless you really have evidence that you’re running oil 20-25C hotter at the same coolant temperatures, you’re treading in dangerous waters and 5W30 is more than enough.
https://penriteoil.com.au/knowledge-centre/Viscosity/237/what-is-an-sae-viscosity/180