UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GRMrj66xG5pDPc8DujK6tV1K1Aiq6WLSg9BHGH0tVZQ=' 
WHERE 
  key_id = '084ecdaae52ddff8967bab9b253e27cfd6ac4a02a20c1f131fc38e78d35a978b' 
  AND (
    token = 'GRMrj66xG5pDPc8DujK6tV1K1Aiq6WLSg9BHGH0tVZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035