40mm won't make an insane difference. What was the original barrel lenght? It's important to provide as much background information (gun manufacturer, model, current setup, etc) as you can with specific questions like these else we can't help you.
http://airsoftcanada.com/showthread.php?t=18038
Read up Madmax' post, And contact Illusion for parts. Between the both of them, you should be ok.
Oh, and if you prefer not opening the mechbox, Illusion also did work on boxes las time I checked.