UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aIUF1qhJuqpvAXVdGr79rJg+aU8Xc/kGje1ROOpBEWk='
WHERE
key_id = '05588c899bea7e6dc7fe7a11b700277d680914e8ba067d5956da6f26c2d616d2'
AND (
token = 'aIUF1qhJuqpvAXVdGr79rJg+aU8Xc/kGje1ROOpBEWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)