UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hnsml7CNU1I4iAiM/bRLMbYWj+ZBA0ziqMr7stt9e/k='
WHERE
key_id = '5f779ce90222854fe77d5d90fd83f95a820d19ea939215f83ba0d20d9a31f87f'
AND (
token = 'hnsml7CNU1I4iAiM/bRLMbYWj+ZBA0ziqMr7stt9e/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)