UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X/avCduP8OISWg7qwDmJM/EX/TSeO3VGgOJiIkxzgQU=' 
WHERE 
  key_id = 'c4c62620e78ba222a8f5ad37ff16125e56ec70efaeadb4f86a6aebb9e9f03c64' 
  AND (
    token = 'X/avCduP8OISWg7qwDmJM/EX/TSeO3VGgOJiIkxzgQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040