UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EEJqd6wXQEp28IKVy4V6Ix5aY0f12//F9BBY/loVspY='
WHERE
key_id = '1a0a4a0bdabcf57155195efe7fa4e190475a500a505b71b3fb27558c6d178c4d'
AND (
token = 'EEJqd6wXQEp28IKVy4V6Ix5aY0f12//F9BBY/loVspY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)