SinRG is right, it does come with both firmware versions. The first shipment or two came with 5.02, then afterward they started showing up with 5.50. It's kind of a 50/50 chance. Unfortunately, there's really no way to tell from the box or the serial number.
However, depending on where you purchase it, you may be able to bring it home and check the firmware and return it if it's not the one you want. I know Best Buy will let you return an opened PSP as long as it's not damaged. But you'll definitely want to check with them before purchasing, about their return policy. Just tell them you're buying it as a gift and you want to make sure it can be returned if the recipient doesn't like it.
.