UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hSw1/8YB495oBX74NnceF6QZ2wjiKJyL1/fTBttvdMU='
WHERE
key_id = '1d707b4fc0ba2dcdc3fddf8e38d06f15d1d9693337550d03bd8f68aee316ecd6'
AND (
token = 'hSw1/8YB495oBX74NnceF6QZ2wjiKJyL1/fTBttvdMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)