UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dBuRgwjoxt1bNlXbGe5uE2Bt9yVGK15j3mt0pl1KNa8=' 
WHERE 
  key_id = '214b1a8444a18c865b6fe189676aaa4943c824fedb4c9da9af80a3ab2fe8d1de' 
  AND (
    token = 'dBuRgwjoxt1bNlXbGe5uE2Bt9yVGK15j3mt0pl1KNa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034