UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OCrsXZLuzBv9w/YwZitKlDD498XRfIlIfNp0d0xQScw='
WHERE
key_id = '6f71934f279ce87e6dd60a53802bc8129a194683bf6c6dbf58a78cd24eb2a5f1'
AND (
token = 'OCrsXZLuzBv9w/YwZitKlDD498XRfIlIfNp0d0xQScw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)