UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w5xYtgWhKxPHJ6XqZ/CZrcKWtjWCE/IBQtLUIBYYQrE='
WHERE
key_id = 'dfaadd7a420f1c718893567925a49068fd7dbc907cb121f7ac32103f3fec5c98'
AND (
token = 'w5xYtgWhKxPHJ6XqZ/CZrcKWtjWCE/IBQtLUIBYYQrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)