MySQL - Order by closest value on multiple columns
Simply add another column,
order by abs(connection-5), abs(level-4) is valid syntax:

select lobby.id, lobby.user_id,
   users.connection, users.level
from lobby INNER JOIN users
ON lobby.user_id = users.id
where lobby.user_id &lt;&gt; 1
  and users.connection between 0 and 10 
  and users.level between 1 and 11
order by abs(connection-5), abs(level-4);