set unique key checks 0 in mydql
Swapping is a 3-step process (for this and many other situations).  Go via a temp id.  Something like:

Update `box_types` `bt` SET `bt`.`box_number` = "-1" where `bt`.`box_type_id` = "3" ;
Update `box_types` `bt` SET `bt`.`box_number` = "5" where `bt`.`box_type_id` = "1" ;
Update `box_types` `bt` SET `bt`.`box_number` = "7" where `bt`.`box_number` = "-1" ;


(If box_number is UNSIGNED, then pick some value that will work:  maybe 0?  Maybe 9999999?)