UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4g5ORIVT7HIAAKPxGFG7Po1LIRRVz8wMeEE5QnedNAo='
WHERE
key_id = '6c08216dab45f1456ae659a99e581195100d876d6f6ba08eaf9215e9eda9d4d3'
AND (
token = '4g5ORIVT7HIAAKPxGFG7Po1LIRRVz8wMeEE5QnedNAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)