UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dFgHuJWdr7Pxl/aRgBhvV9pXivi7XXonTsgPsehiH88='
WHERE
key_id = '5eceb1d23886468bdc680bb61a2ad7880279ad66445129adc796024e4b616ec4'
AND (
token = 'dFgHuJWdr7Pxl/aRgBhvV9pXivi7XXonTsgPsehiH88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)