UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F0oJ7beLDBW1AOeBvZYoAeuoPFZdLaedbRo8HqC6pWk='
WHERE
key_id = '35e9c697c26addd79baf22f90be670697cc63a05b8b7eec6baab9b910a7af7a0'
AND (
token = 'F0oJ7beLDBW1AOeBvZYoAeuoPFZdLaedbRo8HqC6pWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)