UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6dIUFIYrGGjsFamVh3ovog3wsmMz+dxjg+RXN2bZFQc='
WHERE
key_id = 'f6f65757b6de7f75de6f6134a1322f5d2caf18f924d553d6e47fd02e04631af4'
AND (
token = '6dIUFIYrGGjsFamVh3ovog3wsmMz+dxjg+RXN2bZFQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)