UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hoewIy4JstJJsyBL+M6wug2VEuJd8QhQSsywm6jRqE='
WHERE
key_id = 'aa9be0d7e82990c4f9cc7fe8ce5dfe35c9073b98c2425c21750e847075a87252'
AND (
token = '3hoewIy4JstJJsyBL+M6wug2VEuJd8QhQSsywm6jRqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)