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