UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I8gwvVTwZAUAioyrXBNub49HuhgmDwiC/XxdVR73lpw='
WHERE
key_id = '466ef7246b3916a3642590542988d3fd56719afd8d8dcafee2ed71014388dc80'
AND (
token = 'I8gwvVTwZAUAioyrXBNub49HuhgmDwiC/XxdVR73lpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)