UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AKa5R3tM60ARpzTXG87rNRAg/LZqZ1aM2xJq6SQn8bg='
WHERE
key_id = 'fcedaccee8642a1b8e5ecaf7c6e989d953e804bd1b974476d2e59757b89b29bf'
AND (
token = 'AKa5R3tM60ARpzTXG87rNRAg/LZqZ1aM2xJq6SQn8bg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)