UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'djzvIwY+1ZwmMGNPYVBCG2LwWNnMuMgdPHc5BeAuKNc=' 
WHERE 
  key_id = 'c167b0f139affa324c9d7cdd2935a7f1ed122cab0ed20a46e37fad8b808f11c7' 
  AND (
    token = 'djzvIwY+1ZwmMGNPYVBCG2LwWNnMuMgdPHc5BeAuKNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00107