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
1SIMPLEhistorynullALLnullnullnullnull1407100Using where


idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEhistorynullconstPRIMARYPRIMARY4const1100null


Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8