CREATE DEFINER=`jhise`@`localhost` PROCEDURE `user_get_by_session`(in i_session_key char(32))
begin

    select
        users.id user_id
    from
        users
            join user_session on user_session.account_key = users.account_key
    where
            user_session.session_token = i_session_key;

end
