Can the shelving be moved or replaced?
If you do go with the plan to vent through the upper shelf. You'd have to make sure the hot air has somewhere to go.
You want hot are to go up, and out; to take advantage of the laws of physics, and heats' ability to naturally rise.
I'd cut one hole, large enough to accommodate a fan, and pull the hot air out, along with venting below to allow cool air in.