UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eAD2U9s/R7aPeT0/WJNfMb/AgKulNwPoR1JGELVQaxU=' 
WHERE 
  key_id = '8e76b16c2d5b764159a32c97ec2b17ffab0f3d6fa68c73aca0aff40e760d884b' 
  AND (
    token = 'eAD2U9s/R7aPeT0/WJNfMb/AgKulNwPoR1JGELVQaxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042