mysql update user’s password and activation key

You are using the user email as the user login. Your code, formatted for readability, looks like:

$resetQuery = $wpdb -> query(
  $wpdb -> prepare(
    "UPDATE wp_users 
    SET user_pass = %s, user_activation_key = '' 
    WHERE user_login = %s AND user_activation_key = %s", 
    $hashedPwd, 
    $useremail, 
    $key
  )
);

The $useremail argument matches the user_login = %s placeholder.

Having the user_login match user_email is not normal. Unless you have altered your user registration so that the login always matches the email that isn’t going to work, and I suspect that that is your problem. You need to rewrite the query, and/or supporting code, so that either the query matches user_login to user_login or user_email to user_email.