UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBcf7z9vK1aD0WC6sIOC/MkfO6LoMI8qYQPlj2wwrvE='
WHERE
key_id = 'dcf65bcce7c51daad47c71ae95682ec3d36e2fdc16c7ef91375f4b28f26e3674'
AND (
token = 'uBcf7z9vK1aD0WC6sIOC/MkfO6LoMI8qYQPlj2wwrvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)