UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1x/SrTvvlD7H/MGoMqb7W+wV69TJjZXDZsQcDn/CnYI=' 
WHERE 
  key_id = 'de420731b9326751105368ec401ddb447c4be4ca40c00ecad538f7ec93ce4bc6' 
  AND (
    token = '1x/SrTvvlD7H/MGoMqb7W+wV69TJjZXDZsQcDn/CnYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034