UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oTMB6rYNQWiLONw/FAsJ1lb71qJ6fb5sHV1Vc8eDX8g='
WHERE
key_id = 'c6d9713e7a516cf24ddb1801c2edb77daeab0ccc96b59325204df6fcfa5b1e3a'
AND (
token = 'oTMB6rYNQWiLONw/FAsJ1lb71qJ6fb5sHV1Vc8eDX8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)