UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/V2YNcuekfxbRLjt/EcHBNgdVHgfkwILdUm5tuLIQAo='
WHERE
key_id = '10c633b9d36ecf9996b35eddd5cb4ca79cc254726f94579d210b59f031cef91f'
AND (
token = '/V2YNcuekfxbRLjt/EcHBNgdVHgfkwILdUm5tuLIQAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)