UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'duypYUebQGSwm3WhTk1ZLKzeEw3LXzCqBvJZpBKgbZc='
WHERE
key_id = 'c2e437014d3424163f907c6a5c9d1b9c29e06cb4e2cd3904e7500bc269f88d9e'
AND (
token = 'duypYUebQGSwm3WhTk1ZLKzeEw3LXzCqBvJZpBKgbZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)