UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8xkxFimwmziktyVIRg1II6U5bZWwY1gju2iEGCthDmQ='
WHERE
key_id = 'fdd30518dbe4a7d30e831db90f856bd86911d83df5346a92b5a54caf31d0bb35'
AND (
token = '8xkxFimwmziktyVIRg1II6U5bZWwY1gju2iEGCthDmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)