UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CDTk3XuDZV2yFDxpdKml1HFLG6QOzJ/pfdXGPqBFiRw='
WHERE
key_id = '0ba006c5750a6bf549769dd45c9e343adc5816ac9093c432ce387047e262fd30'
AND (
token = 'CDTk3XuDZV2yFDxpdKml1HFLG6QOzJ/pfdXGPqBFiRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)