H Bridge runs for few minutes and MOSFETS start smoking
Motors are like capacitors.  When running they (partially) copy the supply voltage with their back emf and this reduces the current draw. when the supply is disconnected this back emf voltage remains, reducing as they spin down.

In this voltage copying and current reducing behavior they are like capacitors.

When a motor is short circuited it is like applying the brakes.

Using IN for PWM speed control will cause high currents to flow as the motor speeds up form a low speed. and then current will flow the other way as both lower FETs are on and the motor is short-circuited.

Use PWM on the ~SD pin instead.

This will open-circuit the supply allowing the motor to coast while the PWM has the driver in shutdown, instead of convertin all that input power into heat.

PWM is good, but don't drive it a rally car (foot alternately hard on the accelerator and hard on the brakes), let it coast between pulses.