Different execution with same query
It is difficult to say why MySQL Optimizer is choosing a different join order for 5.7 without seeing the optimizer trace for the query.  However, you can force the same join order as 5.5 by using STRAIGHT_JOIN instead of INNER JOIN.  That will tell MySQL to process the tables in the order they are listed.