Index: src/wp-includes/user.php
===================================================================
--- src/wp-includes/user.php	(revision 54361)
+++ src/wp-includes/user.php	(working copy)
@@ -3050,15 +3050,22 @@
 		$user_login = $_POST['user_login'];
 	}
 
+	$user_login = trim( wp_unslash( $user_login ) );
+
 	if ( empty( $user_login ) ) {
 		$errors->add( 'empty_username', __( '<strong>Error:</strong> Please enter a username or email address.' ) );
 	} elseif ( strpos( $user_login, '@' ) ) {
-		$user_data = get_user_by( 'email', trim( wp_unslash( $user_login ) ) );
+		$user_data = get_user_by( 'email', $user_login );
+
 		if ( empty( $user_data ) ) {
+			$user_data = get_user_by( 'login', $user_login );
+		}
+
+		if ( empty( $user_data ) ) {
 			$errors->add( 'invalid_email', __( '<strong>Error:</strong> There is no account with that username or email address.' ) );
 		}
 	} else {
-		$user_data = get_user_by( 'login', trim( wp_unslash( $user_login ) ) );
+		$user_data = get_user_by( 'login', $user_login );
 	}
 
 	/**
Index: tests/phpunit/tests/user/retrievePassword.php
===================================================================
--- tests/phpunit/tests/user/retrievePassword.php	(revision 54361)
+++ tests/phpunit/tests/user/retrievePassword.php	(working copy)
@@ -47,8 +47,7 @@
 	 * @ticket 54690
 	 */
 	public function test_retrieve_password_reset_notification_email() {
-		$message = 'Sending password reset notification email failed.';
-		$this->assertNotWPError( retrieve_password( $this->user->user_login ), $message );
+		$this->assertNotWPError( retrieve_password( $this->user->user_login ), 'Sending password reset notification email failed.' );
 	}
 
 	/**
@@ -64,7 +63,21 @@
 			}
 		);
 
-		$message = 'Sending password reset notification email succeeded.';
-		$this->assertWPError( retrieve_password( $this->user->user_login ), $message );
+		$this->assertWPError( retrieve_password( $this->user->user_login ), 'Sending password reset notification email succeeded.' );
 	}
+
+	/**
+	 * @ticket 53634
+	 */
+	public function test_retrieve_password_should_fetch_user_by_login_if_not_found_by_email() {
+		self::factory()->user->create(
+			array(
+				'user_login' => 'foo@example.com',
+				'user_email' => 'bar@example.com',
+			)
+		);
+
+		$this->assertTrue( retrieve_password( 'foo@example.com' ), 'Fetching user by login failed.' );
+		$this->assertTrue( retrieve_password( 'bar@example.com' ), 'Fetching user by email failed.' );
+	}
 }
