UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oyBE+rJRacQEqJU9/fcM0hySjDXIY+RKy31vEo3jZbE='
WHERE
key_id = '494f2dece5bd7e188c626c2d3195debf45aeebb2c8ca5f9b8255c7bc68143425'
AND (
token = 'oyBE+rJRacQEqJU9/fcM0hySjDXIY+RKy31vEo3jZbE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)