UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OIbUPrcpUxQ+H7jQbXwhd79TumNZJ7r+373bzGs0QlI='
WHERE
key_id = 'cd20abd9f3a1fad8c987b60687a915db6a2e3b0eb1a82444df8133a97c2ca032'
AND (
token = 'OIbUPrcpUxQ+H7jQbXwhd79TumNZJ7r+373bzGs0QlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)