UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vYoEiMwHOTvc/CLXfVzM3EefQTpF96pTKb5k9LLkphc=' 
WHERE 
  key_id = 'c9a2727525fb0a8a7ce7575c4a909d6c11a3b2e7d51189d0378f52ffd90b7787' 
  AND (
    token = 'vYoEiMwHOTvc/CLXfVzM3EefQTpF96pTKb5k9LLkphc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042