Look for an used name brand 80's MTB at garage sales or thrift stores. Get one thats hardtail and has front suspension. Look for one thats Cro-Moly (best) or Hi Tensile (better) at least. Little stickers near the seat advertise this, plain steel bikes don't.
Another good way to seperate the crappy bikes from good ones is to look for a three-piece crank, alloy cranks and chainwheels, linear-pull or v-brakes, name brand fittings, usually shimano, again alloy.
When you get your new ride home, totally strip it down and clean, inspect then repack all bearings with quality bearing grease.
Fit new pads to the brakes and true up the wheels.
Use the existing bike for spares or backup. Put the cruiser bars on it if you like.
Quality MTB's have better brakes than cruisers, and the old ones have better geometry/tube sizes for the engine mounts.
I'm mentioning all this because of you stated need to go 40mph.
40mph with a HT on a bicycle will require full motorcycle grade saftey gear, gloves, boots, helmet ect.
Then 7500rpm (a major over-rev) with a 36t sprocket, a big tail wind or slight down hill, quality road tyres, high-end brakes and a firm grip.
Oh and a slight death wish. For when it locks up at that speed its not ending well.
I can do 40+ mph with my new Apollo Verdict, its a $400, 700c shifter bike.
With the motor, shift kit, and some better parts and tires its an $800 machine.
Everything needs to be perfect and recently serviced.
The rear wheel needs special attention. The bearings don't last long at these loads. I switched to a better hub (Shimano 105 with a Cromoly axle) after only six months. Then a visual inspection before and after each ride, adjusting spokes and bearings as required. Then clean and repack the grease every 6 months.
If its a single speed setup, the stock rag joint and tensioner won't cut it at high speeds. Both will have to be deleted and replaced with more solid mounts. A Grubee HD hub or disc mount hub with adapter and a straight chain run (no tensioner) works well. A chain derail at 40 will hurt big-time. I once locked up at around 30 without gloves and was off work for 3 days.
It was actually the pedal side chain that caused the lockup, not the motor or drive side chain that can also lead to the same situation.
High speed is high dollars when using bicycle parts, and high attention to detail as well.
If you plan to cruise at 25mph ( more realistic ) then a supermarket bike might do.