You don't expect much higher than 24V and IRF510 is rated for 100V VDS. About 4X. Lots of margin. So, in terms of voltage, it's okay.
Let's say you assume a max current in the circuit, of 2A (it should be lower as -> 20W, 12V). The max current of IRF510 is 5.6A. However, since it's a boost converter, you may have peak currents as much as 5X average current. So, you should select a MOSFET with higher current capacity.
1 common MOSFET that you can easily find and that can be used in your design with more than enough margin is IRF540. If you can find IRF510, I'm pretty sure you can find IRF540.
It has a high max VDS -> 100V, high max current handling capacity ID -> 33A, low RDS(on) -> 44mΩ. It should also be pretty cheap.
Hope this helps.
Tahmid.