UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm4xoKD0XaAbLUCCR4EKcMHgZ1G+Ts97u2FOPd9eUtK4=' 
WHERE 
  key_id = '9e29910ac9ee7386fb5a4cab4c42f86ac03f4325b7732f36f2f63b04a7f594f4' 
  AND (
    token = 'm4xoKD0XaAbLUCCR4EKcMHgZ1G+Ts97u2FOPd9eUtK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055