We have wireless power with Qi/MagSafe, and at least MagSafe can pass a serial number.
You could use a “magic” charger through the box (assuming it’s laid out right) to charge the phone and tell it to go into update mode. It could look for some predefined WiFi/Bluetooth/whatever to get info and do what it needs to.
Apple already has full security on OS updates, so you couldn’t apply rogue updates without having a way to crack that.
This special mode could easily be disabled the moment someone starts setting up the iPhone, so it would only work on factory fresh (or perhaps wiped) devices to prevent funny business.