Doing math in SQL can ignore indices

Code
-- tested with MySQL 5.6

-- full table scan
EXPLAIN
SELECT * FROM history
 WHERE id + 300 = 400;

-- uses index
EXPLAIN
SELECT * FROM history
 WHERE id = 400 - 300;
Result
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEhistorynullALLnullnullnullnull1407100.00Using where
0.00081300735473633 ms (with caching enabled)

idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEhistorynullconstPRIMARYPRIMARY4const1100.00null
0.014564990997314 ms (with caching enabled)

Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6