UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yfSi9UfbjSZdnkDJGoKfhUq4o7D7fuXvUMorzYHFEro='
WHERE
key_id = '175a996f8f037d64c024ce444899bb4e68d79ae11e773bee1c6e8bec45d4ee13'
AND (
token = 'yfSi9UfbjSZdnkDJGoKfhUq4o7D7fuXvUMorzYHFEro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)