UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ghoWc8tSakM6d3XZFUqgmGozzgB/fZMBzToM4Cnf2LA='
WHERE
key_id = 'cd395c76f9252c5d7d6f700b9f1990053fa96a89357f448e8c1faa7ff65f9f0f'
AND (
token = 'ghoWc8tSakM6d3XZFUqgmGozzgB/fZMBzToM4Cnf2LA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)