There isn't a straight answer for this, it's different for every engine. What you can do is note your fuel average on 10w40, note any rough idles, any feedback issues, anywhere it is sluggish, how easy it starts, in general, how your engine performs with 10w40.
Pour your 5w30 oil, and after 200 kms so oil has properly settled in, note down fuel average, if the oil eliminated or caused any extra noises ( corolla engines tend to make tappet noises when the wrong grade is used). Note if the engine feels more responsive or lighter.
If 5w30 perfroms better and gives more fuel efficiency, it is then also protecting the engine better.
One more thing, if you use synthetic, it may leak out of some seals, if it doesn't, you can continue using it.