Placing a pump inside an enclosed box is not a good idea, the pump needs air circulation to keep cool if you want it to last long. The best thing to do is mount the pump on an open frame stand to allow maximum air circulation. If you have concerns about any liquid splashing on the electric pump, make a shield that you can mount just above the pump taking care not to cover it directly.
Mounting it in a box will work but it is not advised as it will lessen the life of the pump.