UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZZDQ6KapTqhJbH3FSeuBOYdZeTqQ0zXO/gUuG7zNDYo='
WHERE
key_id = '564ffb44990e1af3a2f61ff379169dcd6ea623d7c92635cd341577b466404aff'
AND (
token = 'ZZDQ6KapTqhJbH3FSeuBOYdZeTqQ0zXO/gUuG7zNDYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)