50 kHz is quite high for this application; if you used (say) 100 Hz you would minimize unwanted power dissipation in the driving circuits.
Also, add ~ 100 Ω in series with the gate of the FET. This will slow down the turn off and avoid damage from inductive spikes. Also add 1-10 uF between supply and ground on the board where you have the driver circuit. If there is excessive inductance (wire length) between the 24 V supply and the circuit, then it would possibly oscillate during turn-on and -off.
Lastly, if this circuit's input could be disconnected from the MCU, it would be safer to add a 10k pulldown at the input to ensure it remains off.
To simplify the circuit, you can eliminate R5, and make R2 10 kΩ.