Using the 30 A receptacle is a dangerous idea. The internals of the receptacle are designed for a maximum of 30 A, and putting 40 A through it could cause a fire. The receptacle needs to be replaced with a 50 A model (since they don't make 40 A receptacles).
It's fine to have a 40 A breaker feeding a 50 A receptacle. You need to also match the wire size to the breaker rating. A 40 A circuit requires at minimum 8 AWG copper wire, or perhaps thicker for longer runs. 6 AWG might be a good idea. Since you are replacing the receptacle, you should make sure that there is a dedicated safety ground (so four wires are run from the circuit breaker to the receptacle.
Also, I doubt that the old oven died because of the wrong receptacle (assuming that the receptacle is undamaged). However, I have heard of equipment being damaged when not properly grounded (My mom's gas range died prematurely after the installers failed to connect the ground). Double-check the voltages by measuring all 6 pairs of voltages using a voltmeter (Should be 240 between lines (L-L), 120 from L-G and L-N, and 0 from N-G).
Use caution when working with electricity. Don't forget to turn off the breaker (and verify that power is disconnected) before disassembling anything.