UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJ95Ze0F/fubM7biyA3+GQKh7oRXk0o6UwBtdUIkPYI='
WHERE
key_id = 'abedef2f91586a1e74ea21d9a557b10bdd566ddaf03a4ad5be8f33b4c42cea2d'
AND (
token = 'cJ95Ze0F/fubM7biyA3+GQKh7oRXk0o6UwBtdUIkPYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)